package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsAccessLogVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * <p>
 * 门禁设备预警日志 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsAccessLog extends BaseEntity<AssetsAccessLogVO> {

    private static final long serialVersionUID = 1L;
    public AssetsAccessLog(AssetsAccessLogVO vo){
        this.warnLogId = vo.getWarnLogId();
        this.accessId = vo.getAccessId();
        this.antennaId = vo.getAntennaId();
        this.assetsCode = vo.getAssetsCode();
        this.warnTime = vo.getWarnTime();
    }

    @Override
    public AssetsAccessLogVO convertToVO(){
        return new AssetsAccessLogVO(this);
    }


    /**
     * ID
     */
    @TableId(value = "warn_log_id", type = IdType.ASSIGN_UUID)
    private Integer warnLogId;

    /**
     * 门禁设备ID
     */
    private String accessId;

    /**
     * 天线ID
     */
    private String antennaId;

    /**
     * 资产编码
     */
    private String assetsCode;

    /**
     * 预警时间
     */
    private LocalDateTime warnTime;

    @TableField(exist = false)
    private String flag;


    public enum ColName {
        warn_log_id, access_id, antenna_id, assets_code, warn_time, 
    }
}
